package com.lwc.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class Rabbitconfig {
    /**
     * 声明延迟队列
     * @return
     */
    @Bean
    public Queue queue(){
        return  new Queue("lazy-queue");
    }

    @Bean
public LazyExchange lazyExchange(){
        return  new LazyExchange("lazy-ex");
}

@Bean
public Binding binding(LazyExchange lazyExchange,Queue queue){
        return BindingBuilder.bind(queue).to(lazyExchange).with("lazy").noargs();
}


}
